const express = require('express');
const router = express.Router();
const logController = require('../controllers/logController');
const { authMiddleware, adminMiddleware } = require('../middleware/auth');

// 客户端上传日志（只需要普通用户认证）
router.post('/client/upload', authMiddleware, logController.uploadClientLogs);

// 其他路由需要管理员身份认证
router.use(authMiddleware);
router.use(adminMiddleware);

// 系统日志
router.get('/system', logController.getSystemLogs);
router.get('/system/export', logController.exportSystemLogs);

// 客户端日志
router.get('/client', logController.getClientLogs);
router.get('/client/export', logController.exportClientLogs);

module.exports = router;
